<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="检查并配置Oracle数据库的Open状态">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="oracle_gud_0015.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="oracle_gud_0016">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>检查并配置Oracle数据库的Open状态</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="oracle_gud_0016"></a><a name="oracle_gud_0016"></a>
  <h1 class="topictitle1">检查并配置Oracle数据库的Open状态</h1>
  <div>
   <p>执行备份时，Oracle数据库所在主机必须处于开机状态，并且Oracle数据库为Open状态。以下步骤说明如何检查并配置Oracle数据库的Open状态。</p>
   <div class="section">
    <h4 class="sectiontitle">操作步骤</h4>
    <ol>
     <li><span>登录Oracle数据库主机，查询数据库安装用户及实例名。</span><p></p>
      <ul>
       <li>如果是Linux操作系统，请执行以下操作。
        <ol type="a">
         <li>使用PuTTY，登录Oracle数据库主机。</li>
         <li>执行以下命令，查询安装数据库的用户名。<pre class="screen">ps -ef | grep pmon</pre> <p>回显类似如下，<em>xxx</em><strong>_pmon_hwdb</strong>所在行的用户即为安装数据库的用户，<em>xxx</em><strong>_pmon_hwdb</strong>中“hwdb”则为数据库实例名称。后续操作均以<strong>oracle</strong>用户为例。</p> <p><span><img src="zh-cn_image_0000002035874017.png"></span></p></li>
        </ol></li>
       <li>如果是Windows操作系统，请执行以下操作。
        <ol type="a">
         <li>以系统管理员登录Oracle数据库主机。</li>
         <li>在键盘上按<span class="uicontrol" id="oracle_gud_0016__zh-cn_topic_0000001656760969_uicontrol11819941114510">“Win+R”</span>，打开运行窗口。</li>
         <li>输入<span class="parmvalue">“regedit”</span>，打开注册表。</li>
         <li>在“HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraDB<em>19Home1</em>”路径下获取对应的值。
          <div class="p">
           其中数据库安装用户名在<span class="parmname">“ORACLE_GROUP_NAME”</span>的值中获取，数据库实例名称为<span class="parmname">“ORACLE_SID”</span>的值。
           <div class="note">
            <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
            <div class="notebody">
             <p>路径中的<em>19Home1</em>仅为示例，请以实际为准。</p>
            </div>
           </div>
          </div> <p><span><img src="zh-cn_image_0000001999595720.png"></span></p></li>
        </ol></li>
      </ul> <p></p></li>
     <li id="oracle_gud_0016__li14919010154311"><a name="oracle_gud_0016__li14919010154311"></a><a name="li14919010154311"></a><span>执行以下命令检查数据库是否已启动。</span><p></p>
      <ul>
       <li>如果是Linux操作系统，请执行以下命令：<p><strong>ps -ef|grep ora</strong></p> <p>回显类似如下存在ora_<em>xx</em>进程，表示数据库已启动。</p> <pre class="screen">[oracle@18csingle45 <font style="font-size:8pt" face="Courier New">~</font>]$ ps -ef|grep ora
oracle    76403      1  0 12:56 ?        00:00:10 ora_m002_orcl
oracle   159932      1  0 14:20 ?        00:00:05 ora_m003_orcl
oracle   175468      1  0 Apr07 ?        00:00:12 ora_pmon_orcl
oracle   175470      1  0 Apr07 ?        00:00:05 ora_clmn_orcl
oracle   175472      1  0 Apr07 ?        00:00:26 ora_psp0_orcl
oracle   175474      1  0 Apr07 ?        00:40:42 ora_vktm_orcl
oracle   175478      1  0 Apr07 ?        00:00:08 ora_gen0_orcl
oracle   175481      1  0 Apr07 ?        00:00:04 ora_mman_orcl
oracle   175485      1  0 Apr07 ?        00:00:50 ora_gen1_orcl
oracle   175488      1  0 Apr07 ?        00:00:09 ora_diag_orcl
oracle   175490      1  0 Apr07 ?        00:00:04 ora_ofsd_orcl
oracle   175493      1  0 Apr07 ?        00:01:27 ora_dbrm_orcl
oracle   175495      1  0 Apr07 ?        00:02:32 ora_vkrm_orcl
oracle   175497      1  0 Apr07 ?        00:00:09 ora_svcb_orcl
oracle   175499      1  0 Apr07 ?        00:00:25 ora_pman_orcl
oracle   175501      1  0 Apr07 ?        00:02:35 ora_dia0_orcl
oracle   175503      1  0 Apr07 ?        00:00:19 ora_dbw0_orcl
oracle   175505      1  0 Apr07 ?        00:00:13 ora_lgwr_orcl
oracle   175507      1  0 Apr07 ?        00:00:35 ora_ckpt_orcl
oracle   175509      1  0 Apr07 ?        00:00:02 ora_lg00_orcl
oracle   175511      1  0 Apr07 ?        00:00:06 ora_smon_orcl
oracle   175513      1  0 Apr07 ?        00:00:01 ora_lg01_orcl
oracle   175515      1  0 Apr07 ?        00:00:18 ora_smco_orcl
oracle   175517      1  0 Apr07 ?        00:00:04 ora_w000_orcl
oracle   175519      1  0 Apr07 ?        00:00:02 ora_reco_orcl
oracle   175521      1  0 Apr07 ?        00:00:04 ora_w001_orcl
oracle   175523      1  0 Apr07 ?        00:00:17 ora_lreg_orcl
oracle   175525      1  0 Apr07 ?        00:00:04 ora_pxmn_orcl
oracle   175529      1  0 Apr07 ?        00:01:05 ora_mmon_orcl
oracle   175531      1  0 Apr07 ?        00:01:02 ora_mmnl_orcl
oracle   175533      1  0 Apr07 ?        00:00:02 ora_d000_orcl
oracle   175535      1  0 Apr07 ?        00:00:02 ora_s000_orcl
oracle   175537      1  0 Apr07 ?        00:00:03 ora_tmon_orcl
oracle   177437      1  0 Apr07 ?        00:00:02 ora_arc0_orcl
oracle   177439      1  0 Apr07 ?        00:00:02 ora_tt00_orcl
oracle   177441      1  0 Apr07 ?        00:00:02 ora_tt01_orcl
oracle   177444      1  0 Apr07 ?        00:00:02 ora_arc1_orcl
oracle   177450      1  0 Apr07 ?        00:00:02 ora_arc2_orcl
oracle   177457      1  0 Apr07 ?        00:00:02 ora_arc3_orcl
oracle   177459      1  0 Apr07 ?        00:00:07 ora_tt02_orcl
oracle   177483      1  0 Apr07 ?        00:00:02 ora_aqpc_orcl
oracle   177494      1  0 Apr07 ?        00:00:04 ora_w002_orcl
oracle   177499      1  0 Apr07 ?        00:00:07 ora_p000_orcl
oracle   177501      1  0 Apr07 ?        00:00:07 ora_p001_orcl
oracle   177503      1  0 Apr07 ?        00:00:07 ora_p002_orcl
oracle   177505      1  0 Apr07 ?        00:00:07 ora_p003_orcl
oracle   177507      1  0 Apr07 ?        00:03:35 ora_cjq0_orcl
oracle   178617      1  0 Apr07 ?        00:00:04 ora_w003_orcl
oracle   179771      1  0 Apr07 ?        00:00:04 ora_w004_orcl
oracle   179794      1  0 Apr07 ?        00:00:02 ora_qm02_orcl
oracle   179800      1  0 Apr07 ?        00:00:03 ora_q002_orcl
oracle   179804      1  0 Apr07 ?        00:00:02 ora_q003_orcl
root     184058 183212  0 14:45 pts/0    00:00:00 su - oracle
oracle   184059 184058  0 14:45 pts/0    00:00:00 -bash
oracle   186418      1  0 14:46 ?        00:00:01 ora_m005_orcl
root     186471 184059  0 14:46 pts/0    00:00:00 su - oracle
oracle   186475 186471  0 14:46 pts/0    00:00:00 -bash
oracle   191769      1  0 Apr07 ?        00:00:05 ora_w005_orcl
oracle   191773      1  0 Apr07 ?        00:00:04 ora_w006_orcl
oracle   191812      1  0 Apr07 ?        00:00:04 ora_w007_orcl
oracle   195441      1  0 14:55 ?        00:00:00 ora_m000_orcl
oracle   198133 239014  0 14:58 pts/1    00:00:00 sqlplus
oracle   198175 198133  0 14:58 ?        00:00:00 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   213064 186475  0 15:13 pts/0    00:00:00 ps -ef
oracle   213065 186475  0 15:13 pts/0    00:00:00 grep --color=auto ora
root     239013  10102  0 Apr07 pts/1    00:00:00 su - oracle
oracle   239014 239013  0 Apr07 pts/1    00:00:00 -bash</pre></li>
       <li>如果是Windows操作系统，请执行以下操作：
        <ol type="a">
         <li id="oracle_gud_0016__li17364121904519">在键盘上按<span class="uicontrol" id="oracle_gud_0016__uicontrol11819941114510">“Win+R”</span>，打开运行窗口。</li>
         <li>输入<span class="parmvalue">“services.msc”</span>，进入服务界面查看服务状态。<p>当“OracleService<em>XXX</em>”服务状态为“正在运行”时，表示数据库已启动。</p></li>
        </ol></li>
      </ul> <p></p></li>
     <li id="oracle_gud_0016__li14572194814339"><span>执行以下命令，登录Oracle数据库实例。</span><p></p>
      <ul id="oracle_gud_0016__ul7420345341">
       <li id="oracle_gud_0016__li15682124913711">OS认证：
        <ul id="oracle_gud_0016__ul89443983816">
         <li id="oracle_gud_0016__li18420124173415">如果是Linux操作系统，请执行以下命令：<p id="oracle_gud_0016__p95148598366"><a name="oracle_gud_0016__li18420124173415"></a><a name="li18420124173415"></a><strong id="oracle_gud_0016__b14236563719">export ORACLE_SID=</strong><em id="oracle_gud_0016__i85144598369">数据库实例名称</em></p> <p id="oracle_gud_0016__p145141259153613"><strong id="oracle_gud_0016__b1597618293715">sqlplus / as sysdba</strong></p></li>
         <li id="oracle_gud_0016__li7402151163816">如果是Windows操作系统，请执行以下操作：
          <ol type="a" id="oracle_gud_0016__ol124110408264">
           <li id="oracle_gud_0016__li624120402267">在键盘上按<span class="uicontrol" id="oracle_gud_0016__oracle_gud_0016_uicontrol11819941114510">“Win+R”</span>，打开运行窗口。</li>
           <li id="oracle_gud_0016__li161821338277">输入<span class="parmvalue" id="oracle_gud_0016__parmvalue122291222476">“cmd”</span>，执行以下命令。<p id="oracle_gud_0016__p1755152313372"><strong id="oracle_gud_0016__b19591532143713">set ORACLE_SID=</strong><em id="oracle_gud_0016__i16755423133718">数据库实例名称</em></p> <p id="oracle_gud_0016__p1075515234379"><strong id="oracle_gud_0016__b540852910371">sqlplus / as sysdba</strong></p></li>
          </ol></li>
        </ul></li>
       <li id="oracle_gud_0016__li105571236103417">数据库认证：
        <ul id="oracle_gud_0016__ul1136516538386">
         <li id="oracle_gud_0016__li1723334817382">如果是Linux操作系统，请执行以下命令：<p id="oracle_gud_0016__p920984963717"><a name="oracle_gud_0016__li1723334817382"></a><a name="li1723334817382"></a><strong id="oracle_gud_0016__b19174355163720">export ORACLE_SID=</strong><em id="oracle_gud_0016__i1420924973715">数据库实例名称</em></p> <p id="oracle_gud_0016__p182093496371"><strong id="oracle_gud_0016__b034785743716">sqlplus</strong></p> <p id="oracle_gud_0016__p17915722412">根据提示输入具备<strong id="oracle_gud_0016__b1691518214115">sysdba</strong>权限的用户：</p> <pre class="screen" id="oracle_gud_0016__screen9915112104114"><em id="oracle_gud_0016__i1915102164113">username </em>as sysdba</pre> <p id="oracle_gud_0016__p159150224117">根据提示输入密码。</p></li>
         <li id="oracle_gud_0016__li122822426407">Windows OS执行以下命令：
          <ol type="a" id="oracle_gud_0016__ol587720252273">
           <li id="oracle_gud_0016__li5168124414479">在键盘上按<span class="uicontrol" id="oracle_gud_0016__oracle_gud_0016_uicontrol11819941114510_1">“Win+R”</span>，打开运行窗口。</li>
           <li id="oracle_gud_0016__li3877172517270">输入<span class="parmvalue" id="oracle_gud_0016__parmvalue2059612503475">“cmd”</span>，执行以下命令。<p id="oracle_gud_0016__p8745723103813"><strong id="oracle_gud_0016__b9408122923816">set ORACLE_SID=</strong><em id="oracle_gud_0016__i12745162318389">数据库实例名称</em></p> <p id="oracle_gud_0016__p15745182333814"><strong id="oracle_gud_0016__b11154427163811">sqlplus</strong></p> <p id="oracle_gud_0016__p71274192512">根据提示输入具备<strong id="oracle_gud_0016__b17349199162611">sysdba</strong>权限的用户：</p> <pre class="screen" id="oracle_gud_0016__screen18896121620243"><em id="oracle_gud_0016__i380114413256">username </em>as sysdba</pre> <p id="oracle_gud_0016__p15251105852511">根据提示输入密码。</p></li>
          </ol></li>
        </ul></li>
      </ul> <p></p></li>
     <li><span>如果<a href="#oracle_gud_0016__li14919010154311">2</a>检查到未启动数据库进程，执行以下命令启动数据库进程。否则请跳过。</span><p></p><p><strong>startup;</strong></p> <p></p></li>
     <li><span>执行以下命令检查数据库状态。</span><p></p><p><strong>select instance_name,status from v$instance;</strong></p>
      <ul>
       <li>当回显中<span class="parmname">“STATUS”</span>为<span class="parmvalue">“open”</span>时，表示数据库为Open状态。</li>
       <li>当回显中<span class="parmname">“STATUS”</span>为非<span class="parmvalue">“open”</span>时，请联系管理员将数据库开启至Open状态后再进行备份。</li>
      </ul> <pre class="screen">SQL&gt; select instance_name,status from v$instance; 
 INSTANCE_NAME    STATUS 
 ---------------- ------------ 
 orcl            open</pre> <p></p></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="oracle_gud_0015.html">步骤1：检查并配置数据库环境</a>
    </div>
   </div>
  </div>
 </body>
</html>